package zlatan_demo05_array

object ClassDemo05 {
  def main(args: Array[String]): Unit = {
    val arr1=Array(4,1,6,5,2,3)

    println(s"arr1的和:${arr1.sum}")
    println(s"arr1的最大值:${arr1.max}")
    println(s"arr1的最小值:${arr1.min}")
    val arr2 =arr1.sorted  //默认升序，求降序时可先升序，在反转
    for (i<-arr2) println(i)
    println("-"*15)
    val arr3=arr1.reverse //反转
    for (i<-arr3) println(i)

  }

}
